<?php
/**
 * @desc   Created by PhpStorm.
 * @author laowng
 * @since  2018/10/24 8:40
 */

namespace app\admin\controller;


use app\admin\service\UserService;
use app\common\controller\Base;
use think\App;
use think\Request;

class AdminUser extends Base
{
    private $_server_user;

    public function __construct(App $app = null, UserService $server_user)
    {
        parent::__construct($app);
        $this->_server_user = $server_user;
    }

    /**
     * 角色管理-列表-
     * @throws \think\exception\DbException
     */
    public function userList(Request $request)
    {
        $where = array(
            'username' => $request->param('name') ?: "",
        );
        $data = $this->_server_user->userList($where);

        $this->assign('data', $data);

        return $this->fetch('index');

    }

    /**
     * 添加角色管理
     */
    public function userAdd(Request $request)
    {
        $data = array(
            'username'=>$request->param('name'),
            'password'=>$request->param('password'),
            'role_id'=>$request->param('role_id')
        );

    }

    /**
     * 删除角色管理-单个/批量
     */
    public function userDel()
    {

    }

}